home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / HotboxSouthMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.6 KB  |  160 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  31 May 1997
  22. //
  23. //  Procedure Name:
  24. //      HotboxSouthMenu
  25. //
  26. //  Description:
  27. //        Create the user customizable Hotbox South Menu for hotbox
  28. //
  29. //  Input Arguments:
  30. //      parent to parent the menu to.
  31. //
  32. //  Return Value:
  33. //      None.
  34. //
  35.  
  36.  
  37.  
  38.  
  39. global proc switchPanelToType(string $panelType) {
  40.     string $curPanel = `getPanel -withFocus`;
  41.     string $firstPanel;
  42.     
  43.     if ($curPanel == "" || $panelType == "")
  44.         return;
  45.     
  46.     // If the panel is torn-off then abort operation.
  47.     //
  48.     int $tornOff = `panel -q -tearOff $curPanel`;
  49.     if ($tornOff) return;
  50.  
  51.  
  52.     switch ($panelType) {
  53.         case "Outliner":
  54.             string $allPanelsOfType[] = `getPanel -typ outlinerPanel`;
  55.             $firstPanel = $allPanelsOfType[0];
  56.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  57.                 outlinerPanel -e -rp $curPanel $firstPanel;
  58.             break;
  59.  
  60.         case "GraphEditor":
  61.             string $allPanelsOfType[] = `getPanel -sty graphEditor`;
  62.             $firstPanel = $allPanelsOfType[0];
  63.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  64.                 scriptedPanel -e -rp $curPanel $firstPanel;
  65.             break;
  66.  
  67.         case "DopeSheet":
  68.             string $allPanelsOfType[] = `getPanel -sty dopeSheetPanel`;
  69.             $firstPanel = $allPanelsOfType[0];
  70.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  71.                 scriptedPanel -e -rp $curPanel $firstPanel;
  72.             break;
  73.  
  74.         case "Hypergraph":
  75.             string $allPanelsOfType[] = `getPanel -sty hyperGraphPanel`;
  76.             $firstPanel = $allPanelsOfType[0];
  77.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  78.                 scriptedPanel -e -rp $curPanel $firstPanel;
  79.             break;
  80.  
  81.         case "Hypershade":
  82.             string $allPanelsOfType[] = `getPanel -sty hyperShadePanel`;
  83.             $firstPanel = $allPanelsOfType[0];
  84.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  85.                 scriptedPanel -e -rp $curPanel $firstPanel;
  86.             break;
  87.             
  88.         case "DynRelationships":
  89.             string $allPanelsOfType[] = `getPanel -sty dynRelEdPanel`;
  90.             $firstPanel = $allPanelsOfType[0];
  91.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  92.                 scriptedPanel -e -rp $curPanel $firstPanel;
  93.             break;
  94.  
  95.         case "Multilister":
  96.             string $allPanelsOfType[] = `getPanel -sty multiListerPanel`;
  97.             $firstPanel = $allPanelsOfType[0];
  98.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  99.                 scriptedPanel -e -rp $curPanel $firstPanel;
  100.             break;
  101.  
  102.         case "RenderView":
  103.             string $allPanelsOfType[] = `getPanel -sty renderWindowPanel`;
  104.             $firstPanel = $allPanelsOfType[0];
  105.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  106.                 scriptedPanel -e -rp $curPanel $firstPanel;
  107.             break;
  108.  
  109.         case "SetEditor":
  110.             string $allPanelsOfType[] = `getPanel -sty relationshipPanel`;
  111.             $firstPanel = $allPanelsOfType[0];
  112.             if ($firstPanel != "" && !`panel -q -to $firstPanel`)
  113.                 scriptedPanel -e -rp $curPanel $firstPanel;
  114.                 relationshipEditorBeginTask($firstPanel,"setMembership",3);
  115.             break;
  116.  
  117.     }    
  118. }
  119.  
  120.  
  121.  
  122. global proc HotboxSouthMenu( string $parent )
  123. {
  124.     setParent -m $parent;
  125.     if( `menu -q -ni $parent` != 0 ) {
  126.         //
  127.         //    Menu is built already - just return
  128.         //
  129.         return;
  130.     }
  131.  
  132.  
  133.     menuItem -rp "N" -l "Outliner"  
  134.         -c "switchPanelToType Outliner";
  135.  
  136.     menuItem -rp "E" -l "Graph Editor"  
  137.         -c "switchPanelToType GraphEditor";
  138.  
  139.     menuItem -rp "SE" -l "Dope Sheet"  
  140.         -c "switchPanelToType DopeSheet";
  141.  
  142.     menuItem -rp "S" -l "Hypergraph"  
  143.         -c "switchPanelToType Hypergraph";
  144.  
  145.     menuItem -rp "SW" -l "Dynamic Relationships"  
  146.         -c "switchPanelToType DynRelationships";
  147.  
  148.     menuItem -rp "W" -l "Hypershade"  
  149.         -c "switchPanelToType Hypershade";
  150.  
  151.     menuItem -rp "NW" -l "Render View"  
  152.         -c "switchPanelToType RenderView";
  153.  
  154.     menuItem -rp "NE" -l "Set Editor"  
  155.         -c "switchPanelToType SetEditor";
  156.  
  157.     setParent -m ..;
  158.  
  159. }
  160.